# Maintainer: Antoni Aloy <aaloytorrens@gmail.com>
pkgname=lbreakouthd
pkgver=1.1.4
pkgrel=0
pkgdesc="Ball-and-paddle game (LBreakout2 successor)"
url="https://lgames.sourceforge.io/LBreakoutHD/"
arch="all"
license="GPL-2.0-or-later"
depends="$pkgname-data"
makedepends="
	gettext-dev
	sdl2-dev
	sdl2_image-dev
	sdl2_mixer-dev
	sdl2_ttf-dev
	"
subpackages="$pkgname-lang $pkgname-data::noarch"
source="https://sourceforge.net/projects/lgames/files/lbreakouthd/lbreakouthd-$pkgver.tar.gz
	0001-fix-undeclared-uint.patch
	format-security.patch
	"
options="!check" # No test suite

prepare() {
	default_prepare
	update_config_sub
}

build() {
	LIBS="-lintl" \
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--sysconfdir=/etc \
		--localstatedir=/var/lbreakouthd \
		--prefix=/usr
	make
}

package() {
	make DESTDIR="$pkgdir" install
}

data() {
	pkgdesc="$pkgdesc (data files)"
	amove usr/share/lbreakouthd
}

sha512sums="
868e9616c3ce59a54c0578268668cdfc5952015f86d7e76d5dce51f24a0676e0c97f4faf895def0a03fd5f38b4c73ef0ef740c308557df42cb759e5b716cee0d  lbreakouthd-1.1.4.tar.gz
4de6934a7840153354f54c5c6a9c14d22e3d5a76030cd33131c2511d97c363d73912d53d3581fd756ff42dec9c7d4e819056e5a2eee5d92064a88a9337abe5eb  0001-fix-undeclared-uint.patch
1600c7cb2c655d775b08961e7752979367c218917f628682e598816e33233cea7c3450c6f03005186dc8f6411d256733da4ed93284d4517608db9167bd189ce5  format-security.patch
"
